import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export const store = new Vuex.Store({
  state() {
    return {
      key: 1
    }

  },
  mutations: {
    // 执行修改 不参与逻辑
    logins(state, payload) {
      state.key = payload;
    }
  },
  actions: {
    // 更新值 只参与逻辑不参与edit
    updateValue({
      commit
    }, payload) {
      commit('updateValue', payload);
    }
  }
});